{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Demander de l'aide sur les forums"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Install the Transformers, Datasets, and Evaluate libraries to run this notebook."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install datasets evaluate transformers[sentencepiece]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from transformers import AutoTokenizer, AutoModel\n",
    "\n",
    "model_checkpoint = \"distilbert-base-uncased\"\n",
    "tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)\n",
    "model = AutoModel.from_pretrained(model_checkpoint)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "text = \"\"\"\n",
    "Generation One is a retroactive term for the Transformers characters that\n",
    "appeared between 1984 and 1993. The Transformers began with the 1980s Japanese\n",
    "toy lines Micro Change and Diaclone. They presented robots able to transform\n",
    "into everyday vehicles, electronic items or weapons. Hasbro bought the Micro\n",
    "Change and Diaclone toys, and partnered with Takara. Marvel Comics was hired by\n",
    "Hasbro to create the backstory; editor-in-chief Jim Shooter wrote an overall\n",
    "story, and gave the task of creating the characthers to writer Dennis O'Neil.\n",
    "Unhappy with O'Neil's work (although O'Neil created the name \"Optimus Prime\"),\n",
    "Shooter chose Bob Budiansky to create the characters.\n",
    "\n",
    "The Transformers mecha were largely designed by Shōji Kawamori, the creator of\n",
    "the Japanese mecha anime franchise Macross (which was adapted into the Robotech\n",
    "franchise in North America). Kawamori came up with the idea of transforming\n",
    "mechs while working on the Diaclone and Macross franchises in the early 1980s\n",
    "(such as the VF-1 Valkyrie in Macross and Robotech), with his Diaclone mechs\n",
    "later providing the basis for Transformers.\n",
    "\n",
    "The primary concept of Generation One is that the heroic Optimus Prime, the\n",
    "villainous Megatron, and their finest soldiers crash land on pre-historic Earth\n",
    "in the Ark and the Nemesis before awakening in 1985, Cybertron hurtling through\n",
    "the Neutral zone as an effect of the war. The Marvel comic was originally part\n",
    "of the main Marvel Universe, with appearances from Spider-Man and Nick Fury,\n",
    "plus some cameos, as well as a visit to the Savage Land.\n",
    "\n",
    "The Transformers TV series began around the same time. Produced by Sunbow\n",
    "Productions and Marvel Productions, later Hasbro Productions, from the start it\n",
    "contradicted Budiansky's backstories. The TV series shows the Autobots looking\n",
    "for new energy sources, and crash landing as the Decepticons attack. Marvel\n",
    "interpreted the Autobots as destroying a rogue asteroid approaching Cybertron.\n",
    "Shockwave is loyal to Megatron in the TV series, keeping Cybertron in a\n",
    "stalemate during his absence, but in the comic book he attempts to take command\n",
    "of the Decepticons. The TV series would also differ wildly from the origins\n",
    "Budiansky had created for the Dinobots, the Decepticon turned Autobot Jetfire\n",
    "(known as Skyfire on TV), the Constructicons (who combine to form\n",
    "Devastator),[19][20] and Omega Supreme. The Marvel comic establishes early on\n",
    "that Prime wields the Creation Matrix, which gives life to machines. In the\n",
    "second season, the two-part episode The Key to Vector Sigma introduced the\n",
    "ancient Vector Sigma computer, which served the same original purpose as the\n",
    "Creation Matrix (giving life to Transformers), and its guardian Alpha Trion.\n",
    "\"\"\"\n",
    "\n",
    "text_fr = \"\"\"\n",
    "Génération 1 est un terme rétroactif pour les personnages de Transformers qui sont apparus\n",
    "entre 1984 et 1993. Les Transformers ont commencé avec les lignes de jouets japonaises \n",
    "des années 1980, Micro Change et Diaclone. Elles présentaient des robots capables\n",
    "de se transformer en véhicules de tous les jours, en objets électroniques ou en armes. \n",
    "Hasbro a acheté les jouets Micro Change et Diaclone, et s'est associé à Takara. \n",
    "Marvel Comics est engagé par Hasbro pour créer l'histoire de fond ; le rédacteur en chef \n",
    "Jim Shooter a écrit une histoire générale et confie la tâche de créer les personnages au \n",
    "scénariste Dennis O'Neil. Mécontent du travail d'O'Neil (bien que ce dernier ait créé \n",
    "le nom \"Optimus Prime\"), Shooter choisit Bob Budiansky pour créer les personnages.\n",
    "\n",
    "Les mecha de Transformers ont été en grande partie conçus par Shōji Kawamori, le créateur\n",
    "de l'anime japonais Macross (qui a été adapté en Robotech en Amérique du Nord). Kawamori\n",
    "a eu l'idée de transformer des mechas transformables alors qu'il travaillait sur les\n",
    "franchises Diaclone et Macross au début des années 1980 (comme le VF-1 Valkyrie dans \n",
    "Macross et Robotech), et ses méchas Diaclone ont plus tard servi de base à Transformers.\n",
    "\n",
    "Le concept principal de la Génération 1 est que l'héroïque Optimus Prime, le méchant\n",
    "Megatron, et leurs meilleurs soldats s'écrasent sur une Terre préhistorique dans l'Arche\n",
    "et le Némésis avant de se réveiller en 1985, Cybertron traversant à toute allure la zone\n",
    "neutre en raison de la guerre. La bande dessinée Marvel faisait à l'origine partie \n",
    "de l'univers principal de Marvel, avec des apparitions de Spider-Man et Nick Fury, \n",
    "plus quelques caméos, ainsi qu'une visite à la Terre Sauvage.\n",
    "\n",
    "La série télévisée Transformers a commencé à peu près à la même époque. \n",
    "Produite par Sunbow Productions et Marvel Productions, puis Hasbro Productions, \n",
    "dès le début elle a contredit les histoires de Budiansky. La série TV montre les Autobots\n",
    "cherchant de nouvelles sources d'énergie et s'écrasent lors de l'attaque des Decepticons. \n",
    "Marvel a interprété les Autobots comme la destruction d'un astéroïde malveillant \n",
    "s'approchant de Cybertron. Shockwave est loyal envers Megatron dans la série TV, \n",
    "et maintient Cybertron dans une impasse en son absence.\n",
    "Cybertron dans une impasse pendant son absence, mais dans la BD, \n",
    "il tente de prendre le commandement des Decepticons. \n",
    "La série télévisée s'écarte aussi radicalement des origines que Budiansky avait \n",
    "créé pour les Dinobots, le Decepticon devenu Autobot Jetfire\n",
    "(connu sous le nom de Skyfire à la télévision), \n",
    "les Constructicons (qui s'associent pour former Devastator) et Oméga Suprême. \n",
    "La bande dessinée Marvel établit très tôt que Prime manie la matrice de création,\n",
    "qui donne la vie aux machines. Dans la saison, l'épisode en deux parties \n",
    "The Key to Vector Sigma a introduit l'ancien ordinateur l'ancien ordinateur\n",
    "Vector Sigma, qui servait le même objectif original que la matrice de création \n",
    "(donner la vie aux Transformers), et son gardien Alpha Trion.\n",
    "\"\"\"\n",
    "\n",
    "inputs = tokenizer(text, return_tensors=\"pt\")\n",
    "logits = model(**inputs).logits"
   ]
  }
 ],
 "metadata": {
  "colab": {
   "name": "Demander de l'aide sur les forums",
   "provenance": []
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
